﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Com.CMS263.PO;

namespace Com.CMS263.DAO
{
    public class AttributeTypeDAO
    {
        public void Add(AttributeType attrType)
        {
            DBHelper.TransInsert(attrType);
        }
        public void Delete(int id)
        {
            DBHelper.TransDeleteByID("AttributeType",id);
        }
        public IList<AttributeType> GetAllAttribute()
        {
            return DBHelper.ExecuteHQL("from AttributeType").List<AttributeType>();
        }
        public AttributeType GetAttributeTypeById(int id)
        {
            return DBHelper.ExecuteHQL("from AttributeType where id="+id+"").UniqueResult<AttributeType>();
        }

        public void Modify(AttributeType at)
        {
            DBHelper.TransUpdate(at);
        }
    }
}
